$(document).ready(function() { HoeDatapp = { appinit: function() { HoeDatapp.HandleSidebartoggle(), HoeDatapp.Handlelpanel(), HoeDatapp.Handlelpanelmenu(), HoeDatapp.Handlethemeoption(), HoeDatapp.Handlesidebareffect(), HoeDatapp.Handlesidebarposition(), HoeDatapp.Handlecontentheight(), HoeDatapp.Handlethemecolor(), HoeDatapp.Handlenavigationtype(), HoeDatapp.Handlesidebarside() }, Handlesidebarside: function() { $("#navigation-side").on("change", function() { "rightside" == $(this).val() ? ($("body").attr("hoe-nav-placement", "right"), $("body").attr("hoe-navigation-type", "vertical"), $("#hoeapp-wrapper").removeClass("compact-hmenu")) : ($("body").attr("hoe-nav-placement", "left"), $("body").attr("hoe-navigation-type", "vertical"), $("#hoeapp-wrapper").removeClass("compact-hmenu")) }) }, Handlenavigationtype: function() { $("#navigation-type").on("change", function() { "horizontal" == $(this).val() ? ($("body").attr("hoe-navigation-type", "horizontal"), $("#hoeapp-wrapper").removeClass("compact-hmenu"), $("#hoe-header, #hoeapp-container").removeClass("hoe-minimized-lpanel"), $("body").attr("hoe-nav-placement", "left"), $("#hoe-header").attr("hoe-color-type", "logo-bg7")) : "horizontal-compact" == $(this).val() ? ($("body").attr("hoe-navigation-type", "horizontal"), $("#hoeapp-wrapper").addClass("compact-hmenu"), $("#hoe-header, #hoeapp-container").removeClass("hoe-minimized-lpanel"), $("body").attr("hoe-nav-placement", "left"), $("#hoe-header").attr("hoe-color-type", "logo-bg7")) : "vertical-compact" == $(this).val() ? ($("body").attr("hoe-navigation-type", "vertical-compact"), $("#hoeapp-wrapper").removeClass("compact-hmenu"), $("#hoe-header, #hoeapp-container").addClass("hoe-minimized-lpanel"), $("body").attr("hoe-nav-placement", "left")) : ($("body").attr("hoe-navigation-type", "vertical-compact"), $("#hoeapp-wrapper").removeClass("compact-hmenu"), $("#hoe-header, #hoeapp-container").removeClass("hoe-minimized-lpanel"), $("body").attr("hoe-nav-placement", "left")) }) }, Handlethemecolor: function() { function e() { $("#theme-color > a.header-bg").on("click", function() { $("#hoe-header > .hoe-right-header").attr("hoe-color-type", $(this).attr("hoe-color-type")) }) } function a() { $("#theme-color > a.lpanel-bg").on("click", function() { $("#hoeapp-container").attr("hoe-color-type", $(this).attr("hoe-color-type")) }) } function o() { $("#theme-color > a.logo-bg").on("click", function() { $("#hoe-header").attr("hoe-color-type", $(this).attr("hoe-color-type")) }) } e(), a(), o() }, Handlecontentheight: function() { function e() { var e = $(window).height(), a = $("#hoe-header").innerHeight(), o = $(".my_footer").innerHeight(), h = $("#top-header").innerHeight(), t = e - a -h - o - 1, n = e - a - h - 1; $("#main-content ").css("min-height", t), $(".hoe-left-panel").css("height", n) } e(), $(window).resize(function() { e() }) }, Handlesidebarposition: function() { $("#sidebar-position").on("change", function() { "fixed" == $(this).val() ? $("#hoe-left-panel,.hoe-left-header").attr("hoe-position-type", "fixed") : $("#hoe-left-panel,.hoe-left-header").attr("hoe-position-type", "absolute") }) }, Handlesidebareffect: function() { $("#leftpanel-effect").on("change", function() { "overlay" == $(this).val() ? $("#hoe-header, #hoeapp-container").attr("hoe-lpanel-effect", "overlay") : "push" == $(this).val() ? $("#hoe-header, #hoeapp-container").attr("hoe-lpanel-effect", "push") : $("#hoe-header, #hoeapp-container").attr("hoe-lpanel-effect", "shrink") }) }, Handlethemeoption: function() { $(".selector-toggle > a").on("click", function() { $("#styleSelector").toggleClass("open") }) }, Handlelpanelmenu: function() { $(".hoe-has-menu > a").on("click", function() { var e = $(this).closest(".hoe-minimized-lpanel").length; if (0 === e) { $(this).parent(".hoe-has-menu").parent("ul").find("ul:visible").slideUp("fast"), $(this).parent(".hoe-has-menu").parent("ul").find(".opened").removeClass("opened"); var a = $(this).parent(".hoe-has-menu").find(">.hoe-sub-menu"); a.is(":hidden") ? (a.slideDown("fast"), $(this).parent(".hoe-has-menu").addClass("opened")) : ($(this).parent(".hoe-has-menu").parent("ul").find("ul:visible").slideUp("fast"), $(this).parent(".hoe-has-menu").removeClass("opened")) } }) }, HandleSidebartoggle: function() { $(".hoe-sidebar-toggle a").on("click", function() { var device = $("#hoeapp-wrapper").attr("hoe-device-type"); //tuanha: 17/05/2017 if("phone" == device){ var isOpen = $("#hoeapp-wrapper").hasClass("hoe-hide-lpanel"); if(isOpen){ $("#main-content").css("position","absolute"); // $("#main-content").css("margin-left","0px"); }else{ $("#main-content").css("position","relative"); // $("#main-content").css("margin-left","210px"); } }else{ var isMaximized = $("#hoe-header").hasClass("hoe-minimized-lpanel"); if(isMaximized){ $("#hoe-home-icon").css("display","inline"); $(".CountTimeOut").css("display","inline"); }else{ $("#hoe-home-icon").css("display","none"); $(".CountTimeOut").css("display","none"); } } "phone" !== $("#hoeapp-wrapper").attr("hoe-device-type") ? ($("#hoeapp-container").toggleClass("hoe-minimized-lpanel"), $("#hoe-header").toggleClass("hoe-minimized-lpanel")) : $("#hoeapp-wrapper").hasClass("hoe-hide-lpanel") ? $("#hoeapp-wrapper").removeClass("hoe-hide-lpanel") : $("#hoeapp-wrapper").addClass("hoe-hide-lpanel") }) }, Handlelpanel: function() { function e() { var e = $(window)[0].innerWidth; e >= 768 && 1024 >= e ? ($("#hoeapp-wrapper").attr("hoe-device-type", "tablet"), $("#hoe-header, #hoeapp-container").addClass("hoe-minimized-lpanel"), $("li.theme-option select").attr("disabled", !1)) : 768 > e ? ($("#hoeapp-wrapper").attr("hoe-device-type", "phone"), $("#hoe-header, #hoeapp-container").removeClass("hoe-minimized-lpanel"), $("li.theme-option select").attr("disabled", "disabled")) : ($("#hoeapp-wrapper").attr("hoe-device-type", "desktop"), $("#hoe-header, #hoeapp-container").removeClass("hoe-minimized-lpanel"), $("li.theme-option select").attr("disabled", !1)) } e(), $(window).resize(e) } }, HoeDatapp.appinit() });